const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    name: { type: String },
    avatar: { type: String },
    title: { type: String },
    categories: [{ ref: 'Category', type: mongoose.Schema.Types.ObjectId }],
    scores: {
        difficult: { type: Number },
        skills: { type: Number },
        attack: { type: Number },
        survive: { type: Number },
    },
    skills: [{
        icon: { type: String },
        name: { type: String },
        description: { type: String },
        tips: { type: String },
    }],
    items1: [{ ref: 'Item', type: mongoose.Schema.Types.ObjectId }],
    items2: [{ ref: 'Item', type: mongoose.Schema.Types.ObjectId }],
    usageTips: { type: String },
    battleTips: { type: String },
    teamTips: { type: String },
    partner: [{
        hero: { ref: 'Hero', type: mongoose.Schema.Types.ObjectId },
        description: { type: String }
    }]
})

module.exports = mongoose.model('Hero', schema)